<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //js的循环？ 效率更高

        // for...of  for...in  forEach()
        for (let i = 0; i < 10; i++) {
            console.log(i);
        }

        // 求1-100的和
        var sum = 0;

        for (let index = 0; index <= 100; index++) {  
            sum += index;    
        }
        console.log(sum);
        
    </script>
</body>
</html>